<?php

namespace app\common\model;

/**
 * [Renzhen  认证表]
 * @author [C。]
 * @return html
 */
class Renzhen extends Base
{
    protected $name = 'renzhen';
    /**
     * 根据搜索条件获取寺院列表信息
     */
    public function getlists($map,$from = 0, $size = 5,$field = '*')
    {
        $order = ['r.id' => 'desc'];
        $join = [
            ['app_member m','m.id = r.uid'],
        ];
        $result =  $this->field($field)
            ->alias('r')
            ->join($join)
            ->where($map)
            ->order($order)
            ->limit($from, $size)
            ->select();

        return $result;
    }

    /**
     * 搜索获取寺院列表总数
     * @param array $param
     */
    public function getCounts($map) {
        $join = [
            ['app_member m','m.id = r.uid'],
        ];
        return $this
            ->alias('r')
            ->join($join)
            ->where($map)
            ->count();
    }
}